export default {
  bind(el, binding, vnode, oldVnode){
    let arr = binding.value
    window.addEventListener('scroll', function () {
      var scrollTop = document.documentElement.scrollTop
      let target = el.firstChild
      if (scrollTop > arr[1] && scrollTop <= arr[2]){
        target.style.backgroundColor = "rgba(0,0,0,.5)"
      }else if (scrollTop > arr[2]){
        target.style.backgroundColor = "#0e2335"
      }else {
        target.style.backgroundColor = "rgba(0,0,0,0)"

      }
    }, false)

  }
}
